[DEPRECATED: Use GET /manage/v2/servers/{id|name}/properties instead.]
Retrieve the namespace URI associated with the REST service
namespace binding prefix {prefix}
.
URL Parameters | |
---|---|
format? |
The expected format of the response, either xml or
json . Overrides the format specified in the Accept header.
|
Response Headers | |
---|---|
Content-Type |
The MIME type of the content returned in the response body, either
application/xml or application/json .
|
Upon success, MarkLogic Server returns status 200 and returns the
requested information in the response body, as either XML or JSON.
If no namespace binding exists for {prefix}
, MarkLogic
server returns 404 (Not Found).
The response body has the following format when requesting XML:
<namespace xmlns="http://marklogic.com/rest-api"> <prefix>the-prefix</prefix> <uri>the-uri</uri> </namespace>
The response body has the following format when requesting JSON:
{ "prefix" : "the-prefix", "uri" : "the-uri" }
rest-reader
role, or the
following privilege:
http://marklogic.com/xdmp/privileges/rest-reader
For details, see Using Namespace Bindings in the REST Application Developer's Guide.
The expected response type can be specified using either the
format
parameter or Accept
header. One or
the other must be supplied. If both are supplied and are different,
the format
parameter takes precedence.
$ curl --anyauth --user user:password -i -X GET -H "Accept: application/xml" \ 'http://localhost:8004/v1/config/namespaces/will' ==> MarkLogic Server responds with status 200 and returns the namespace binding information for prefix "will", as XML. For example: Server: MarkLogic Content-Type: text/xml; charset=UTF-8 Content-Length: 211 Connection: close HTTP/1.1 200 OK Server: MarkLogic Content-Type: text/xml; charset=UTF-8 Content-Length: 170 Connection: close <rapi:namespace xmlns:rapi="http://marklogic.com/rest-api"> <rapi:prefix>will</rapi:prefix> <rapi:uri>http://marklogic.com/examples/shakespeare</rapi:uri> </rapi:namespace>
$ curl --anyauth --user user:password -X GET -i -H "Accept: application/json" \ 'http://localhost:8004/v1/config/namespaces/will' ==> MarkLogic Server responds with status 200 and returns the namespace binding information for prefix "will", as JSON. For example: Server: MarkLogic Content-Type: text/xml; charset=UTF-8 Content-Length: 211 Connection: close HTTP/1.1 200 OK Server: MarkLogic Content-Type: text/plain; charset=UTF-8 Content-Length: 67 Connection: close { "prefix":"will", "uri":"http://marklogic.com/examples/shakespeare" }
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.